package com.example.phoneshop.service.impl;

import com.example.phoneshop.dao.UserDao;
import com.example.phoneshop.entity.User;
import com.example.phoneshop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author nozomi
 * @date 2018/7/7 16:27
 * @description
 */
@Service
public class UserServiceImpl implements UserService {
    private final UserDao userDao;

    @Autowired
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public User findUserByPhone(String phone) {
        return userDao.findUserByPhone(phone);
    }

    @Override
    public int insertUser(Map map) {
        return userDao.insertUser(map);
    }

    @Override
    public User findUserByEmail(String email) {
        return userDao.findUserByEmail(email);
    }

    @Override
    public List<Map> findUserAll() {
        return userDao.findUserAll();
    }

    @Override
    public int delete(int id) {
        return userDao.delete(id);
    }
}
